<?php
require_once('../../auth/auth.php');

   $adopter_id = $_POST['adopter_id'] ;  
	$family_id=$_POST['family_id']; 		
	
include 'db_Connect.php';

$adopter_query = "UPDATE User SET family_in_need_match='".$family_id."' WHERE user_id ='".$adopter_id."'";
$result = mysql_query($adopter_query);

echo $adopter_query;

if($result){
	echo("Adopter User successfully updated");

} else{
	echo("Adopter User update failed");
}

$family_query = "UPDATE Families SET adoptive_family_user='".$adopter_id."' WHERE family_id ='".$family_id."'";
$result = mysql_query($family_query);

echo $family_query;

if($result){
	echo("Family User successfully updated");

} else{
	echo("Family User update failed");
}

include 'db_Close.php';

		header("location: ../administrator.php");

?>